@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 3.9%;
  --primary: 142 76% 36%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --accent: 0 0% 96.1%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 89.8%;
  --input: 0 0% 89.8%;
  --ring: 142 76% 36%;
}

body {
  background-color: white;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-apple {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
}

/* Enhanced scrollbar styles */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.4);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.6);
}

.scrollbar-thin::-webkit-scrollbar-corner {
  background: transparent;
}

.scrollbar-thumb-gray-300 {
  scrollbar-color: rgba(209, 213, 219, 0.6) transparent;
}

.scrollbar-thumb-gray-300::-webkit-scrollbar-thumb {
  background-color: rgba(209, 213, 219, 0.6);
}

.scrollbar-track-transparent {
  scrollbar-color: transparent transparent;
}

.scrollbar-track-transparent::-webkit-scrollbar-track {
  background: transparent;
}

/* Enhanced prose styles for markdown rendering */
.prose {
  color: #374151;
  line-height: 1.75;
  max-width: none;
}

.prose h1 {
  color: #111827;
  font-weight: 700;
  font-size: 1.875rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.prose h2 {
  color: #111827;
  font-weight: 600;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.prose h3 {
  color: #111827;
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.prose p {
  margin-bottom: 1.25rem;
  color: #4b5563;
}

.prose strong {
  color: #111827;
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: #6b7280;
}

.prose ul,
.prose ol {
  margin: 1.25rem 0;
  padding-left: 1.75rem;
}

.prose li {
  margin: 0.75rem 0;
  color: #4b5563;
}

.prose blockquote {
  border-left: 4px solid #10b981;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #6b7280;
  background: linear-gradient(to right, #f0fdf4, transparent);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.prose code {
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color: #374151;
}

/* Enhanced button hover effects */
.button-hover-effect {
  position: relative;
  overflow: hidden;
}

.button-hover-effect::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.button-hover-effect:hover::before {
  left: 100%;
}

/* Enhanced card hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Message bubble enhancements */
.message-bubble {
  position: relative;
  backdrop-filter: blur(10px);
}

.message-bubble.user::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid;
  border-left-color: inherit;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.message-bubble.assistant::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 16px;
  width: 0;
  height: 0;
  border-right: 8px solid white;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Enhanced focus states */
.input-focus-ring {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.6);
}

/* Gradient text effects */
.gradient-text {
  background: linear-gradient(135deg, #10b981, #059669, #047857);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced animations */
@keyframes ripple {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Improved accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  .prose h1 {
    font-size: 1.5rem;
  }

  .prose h2 {
    font-size: 1.25rem;
  }

  .prose h3 {
    font-size: 1.125rem;
  }
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  .prose {
    color: black !important;
  }
}
